<%@ page import="javax.servlet.http.HttpSession" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <link href="layui/css/layui.css" rel="stylesheet">
    <title>Dashboard</title>
</head>

<body>
<iframe height="70px" width="100%" src="top.jsp"></iframe>
<iframe height="700px" width="12%" src="left.jsp"></iframe>
<iframe id="right-iframe" height="700px" width="87%" src="right.jsp"></iframe>
<iframe height="100px" width="100%" src="down.jsp"></iframe>
<script src="js/1.js"></script>
<script src="layui/layui.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script>
    $(document).ready(function() {
        // 监听点击“食谱管理”菜单项
        $('#recipe-management').click(function() {
            // 发起 AJAX 请求访问后台的 @WebServlet("/recipe")
            $.ajax({
                url: '/recipe', // 调用后台 Servlet
                type: 'GET', // 请求方法
                success: function(response) {
                    // 将后台返回的 HTML 内容放入功能区
                    $('#content-area').html(response);
                },
                error: function() {
                    // 错误处理
                    console.log("加载失败");
                    $('#content-area').html('<p>加载失败，请稍后再试。</p>');
                }
            });
        });
    });
</script>


</body>
</html>
